import { Component } from '@angular/core';
import {NavController, NavParams } from 'ionic-angular';
import {HttpServies} from '../../providers/http-servies';
import 'rxjs/add/operator/toPromise';
import { Buffer } from 'buffer';



@Component({
  selector: 'page-stare',
  templateUrl: 'stare.html',
  providers:[HttpServies]
})
export class StarePage {
  url:any=[];
  mobile:any=[];
  yeJson:any=[];
  constructor(public navCtrl: NavController, public navParams: NavParams,private http:HttpServies) {

  }
  ionViewDidLoad() {
    var mobile=localStorage.getItem("mobile");
    var mobiles=new Buffer(mobile).toString('base64');
    // params.set("password", Md5.hashStr(this.password).toString());

    // var mobiles=console.log(Md5.hashStr(mobile));
    var domain = window.location.host;
    this.url="http://"+domain+"?yqr="+mobiles+"#/register";

      var param='mobile='+mobiles;
      this.http.httpPost('/home/homepage/junior', param)
          .then(res => {
            if (res && res.code ==1) {
              // this.http.showErro(res.msg);
              this.yeJson = res.data;
            }
          })

  }






}
